package com.rui.cn.provider.service.system.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.rui.cn.entity.system.SysLog;
import com.rui.cn.provider.repository.system.SysLogDao;
import com.rui.cn.provider.service.system.SysLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zhang123
 * @since 2018-01-20
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class SysLogServiceImpl extends ServiceImpl<SysLogDao,SysLog> implements SysLogService {
    @Autowired
    private SysLogDao sysLogDao;

    @Override
    public void insertLog(SysLog loggerEntity) {
        sysLogDao.insert(loggerEntity);
    }

    @Override
    public List<SysLog> logList(Pagination pagination) {
        return sysLogDao.selectPage(pagination,   new EntityWrapper<SysLog>());
    }
}
